java.lang.Object
ddejonge.bandana.tools.Turn
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Turn>
public class Turn extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Turn>
Immutable class that represents a year/phase pair.
- Author:
- Dave de Jonge
- See Also:
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description int
compareTo(Turn other)
Returns a positive value if this turn comes after the given other turn.boolean
equals(java.lang.Object obj)
Turn
getNext()
Returns a new Turn object representing the next turn.static es.csic.iiia.fabregues.dip.board.Phase
getNextPhase(es.csic.iiia.fabregues.dip.board.Phase phase)
es.csic.iiia.fabregues.dip.board.Phase
getPhase()
Turn
getPrevious()
Returns a new Turn object representing the previous turn.static es.csic.iiia.fabregues.dip.board.Phase
getPreviousPhase(es.csic.iiia.fabregues.dip.board.Phase phase)
int
getYear()
int
hashCode()
boolean
isBuildPhase()
static boolean
isBuildPhase(es.csic.iiia.fabregues.dip.board.Phase phase)
boolean
isMovePhase()
static boolean
isMovePhase(es.csic.iiia.fabregues.dip.board.Phase phase)
boolean
isRetreatPhase()
static boolean
isRetreatPhase(es.csic.iiia.fabregues.dip.board.Phase phase)
java.lang.String
toString()
-
Constructor Details
-
Method Details
-
isMovePhase
public static boolean isMovePhase(es.csic.iiia.fabregues.dip.board.Phase phase) -
isRetreatPhase
public static boolean isRetreatPhase(es.csic.iiia.fabregues.dip.board.Phase phase) -
isBuildPhase
public static boolean isBuildPhase(es.csic.iiia.fabregues.dip.board.Phase phase) -
getNext
Returns a new Turn object representing the next turn.- Returns:
-
getPrevious
Returns a new Turn object representing the previous turn.- Returns:
-
getYear
public int getYear() -
getPhase
public es.csic.iiia.fabregues.dip.board.Phase getPhase() -
isMovePhase
public boolean isMovePhase() -
isRetreatPhase
public boolean isRetreatPhase() -
isBuildPhase
public boolean isBuildPhase() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
Returns a positive value if this turn comes after the given other turn.- Specified by:
compareTo
in interfacejava.lang.Comparable<Turn>
- Parameters:
other
-- Returns:
-
getNextPhase
public static es.csic.iiia.fabregues.dip.board.Phase getNextPhase(es.csic.iiia.fabregues.dip.board.Phase phase) -
getPreviousPhase
public static es.csic.iiia.fabregues.dip.board.Phase getPreviousPhase(es.csic.iiia.fabregues.dip.board.Phase phase)
-